Vue.component('vanNavBar', {
    template: `<div class="van-nav-bar">
    <span @click="$emit('click-left')">&lt;返回</span>
    <span>{{title}}</span>
    <span @click="$emit('click-right')">搜索</span>
  </div>`,
    props: ['title']

})

Vue.component('vanButton', {
    template: `<button @click="$emit('click')" class="van-button" :style="{background: type}">{{title}}</button>`,
    props: ['title', 'type']
})

Vue.component('van-loading', {
    template: `<div class="van-loading" v-show="show"></div>`,
    props: {
        show: Boolean
    },
    // props:['show']
})

Vue.component('van-tips', {
    template: '<div class="van-tips" v-show="show">{{title}}</div>',
    props: {
        show: Boolean,
        title: String
    }
})

Vue.component('van-table', {
    template: `<table border="1" cellpadding="20" cellspacing="0">
    <tr>
      <th v-for="item in columns">{{item.title}}</th>
    </tr>
    <tr v-for="item in data">
      <td v-for="col in columns">
      {{item[col.key]}}
      </td>
    </tr>
</table>`,
    props: ['columns', 'data']
})